package com.heima.com;

import java.util.ArrayList;
import java.util.function.Predicate;
import java.util.stream.Stream;

public class Demo3 {
    public static void main(String[] args) {
        ArrayList<Integer> aList = new ArrayList<>();
        for (int i =1; i<=10;i++){
            aList.add(i);
        }
        Stream<Integer> integerStream = aList.stream().filter(new Predicate<Integer>() {
            @Override
            public boolean test(Integer integer) {
                return integer > 2;

            }
        });
       integerStream.forEach(s-> System.out.println(s));


    }
}
